home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1995 November
/
EnigmA AMIGA RUN 02 (1995)(G.R. Edizioni)(IT)[!][issue 1995-11][Skylink CD].iso
/
earcd
/
util
/
text
/
hp540_fw.lzh
/
PrintEnvelope.public
Wrap
Text File
|
1995-09-08
|
3KB
|
66 lines
/* filename: PrintEnvelope */
/* version: 1.0 8 Sep 95 */
/* */
/* purpose: FinalWriter macro to print a return and recipient address on a */
/* single-fed envelope on an HP540 (5xx/6xx series) printer */
/* */
/* syntax: called from within FinalWriter */
/* */
/* author: Jim Dutton */
/* jimd@slip106.termserv.siu.edu */
/* ca0008@siucvmb.siu.edu */
/* */
/* prereqs: ENV:FW/MyName, ENV:FW/MyAddress, ENV:FW/MyCityStateZip */
/* */
/* usage: set the prerequisite Environment variables with your desired */
/* return address (it is assumed that only 3 lines are needed) */
/* */
/* create FW document WITH recipient address as part of the text, */
/* in the format of a mailing address (ie; seperate lines) */
/* */
/* highlight the recipient address text and invoke this macro */
/* */
/* comments: the UNIVERS font is preselected - the envelope print setup is */
/* predetermined by the printer - only use envelopes that your */
/* printer supports - the "EXTRACT" comment obtains the recipient */
/* address data from FinalWriter */
Options Results
If ~open(hp540,'PAR:') then
Do; say '** Unable to open PARallel port **'; Exit 32; End
If ~open(envname,"ENV:FW/MyName") then
Do; say '** Unable to open ENV:FW/MyName **"; Exit 33; End
myname = strip(readln(envname)); duh = close(envname)
If ~open(envaddr,"ENV:FW/MyAddress") then
Do; say '** Unable to open ENV:FW/MyAddress **'; Exit 34; End
myaddress = strip(readln(envaddr)); duh = close(envaddr)
If ~open(envstate,"ENV:FW/MyCityStateZip") then
Do; say '** Unable to open ENV:FW/MyCityStateZip **; Exit 35; End
myCityStateZip = strip(readln(envstate)); duh = close(envstate)
esc = '1B'x; reset = esc || "E"; line_termination = esc || "&k3G"
univers = esc || "(s1p12v0s0b52T"
paper_size.envelope = esc || "&l81A"
EnvelopeFeed = esc || "&l3H"
LeftMargin50_Skip8Rows = esc || "&a50l&a+8R"
duh = writeln(hp540,line_termination)
duh = writech(hp540,univers)
duh = writech(hp540,paper_size.envelope)
duh = writeln(hp540,EnvelopeFeed)
duh = writeln(hp540,myname); duh = writeln(hp540,myaddress)
duh = writeln(hp540,myCityStateZip)
duh = writeln(hp540,LeftMargin50_Skip8Rows)
"Extract"
duh = writech(hp540,Result)
duh = writeln(hp540,reset); duh = close(hp540)
Exit